/* style.css */
/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(to right, #f0fff0, #e0f7fa);
}

/* 页眉样式 */
header {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    text-align: center;
}

.subtitle {
    background: #81C784;
    padding: 0.5rem;
    color: #fff;
}

/* 导航栏样式 */
nav {
    background: #388E3C;
    padding: 1rem;
}

nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

nav a:hover {
    background: #81C784;
    border-radius: 4px;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 轮播图样式 */
.carousel {
    position: relative;
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    /* 新增容器尺寸控制 */
    height: 600px; /* 设置固定高度 */
    width: 100%;   /* 宽度自适应父容器 */
}

.slides {
    position: relative;
    height: 100%; /* 继承carousel高度 */
}

.slides img {
    /* 修改尺寸控制方式 */
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例并填充容器 */
    opacity: 0;        /* 替代display切换 */
    transition: opacity 0.5s ease-in-out;
}

.slides img.active {
    opacity: 1; /* 替代display:block */
    z-index: 1; /* 确保激活图片在最上层 */
}

.carousel button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel button:hover {
    background: rgba(255,255,255,0.8);
}

.prev { left: 0; }
.next { right: 0; }

/* 计算器样式 */
.calculator {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.calc-container {
    max-width: 300px;
    margin: 0 auto;
}

#display {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: right;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

button {
    padding: 1rem;
    border: none;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: #388E3C;
}

.clear {
    width: 100%;
    margin-top: 1rem;
    background: #f44336;
}

/* 音乐播放器样式 */
.music-player {
    text-align: center;
    margin: 2rem 0;
}

.music-btn {
    padding: 1rem 2rem;
    margin-top: 1rem;
}

/* 页脚样式 */
footer {
    background: #388E3C;
    color: white;
    text-align: center;
    padding: 1rem;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
}

footer a:hover {
    text-decoration: underline;
}

/* 时间线样式 */
/* 新增时间线样式 */
.history-img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-content a {
    color: #2e7d32;
    text-decoration: underline;
    font-weight: 500;
}

.timeline-content a:hover {
    color: #1b5e20;
}

.timeline-item {
    margin-bottom: 2rem;
    padding: 15px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timeline-date {
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    color: #388E3C;
    margin-bottom: 0.5rem;
}
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #4CAF50;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-date {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
}

/* 名将画廊 */

/* 新增样式 */
.player-info {
    padding: 1.5rem;
}

.player-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.player-stats ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.rivalry-highlight {
    border-left: 4px solid #4CAF50;
    padding-left: 1rem;
    margin: 1rem 0;
}

.play-style {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.style-tag {
    background: #4CAF50;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9em;
}

.head-to-head {
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.h2h-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 1.5rem 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2e7d32;
}

.quote {
    font-style: italic;
    color: #666;
    margin-top: 1rem;
}

.nation {
    font-size: 1.2em;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.player-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.player-card:hover {
    transform: translateY(-5px);
}

.player-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* 小游戏样式 */

.mini-game {
    position: relative;
    text-align: center;
    padding: 2rem;
}

#gameCanvas {
    border: 3px solid #2e7d32;
    background: #e8f5e9;
    border-radius: 10px;
    margin: 1rem 0;
}

.game-controls {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.game-controls button {
    margin: 0 1rem;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    background: #4CAF50;
    border: 2px solid #388E3C;
}

.game-controls button:active {
    transform: scale(0.95);
}s

nav a[href*="currentpage"] {
    background: #81C784;
    border-radius: 4px;
}


body {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}